//      secondstep_page.cpp
//

#include "secondstep_page.h"
#include <QDebug>

SecondStepPage::SecondStepPage(QVector<qreal> mass,
                            QVector<qreal> w2,
                            QVector<quint32> s2,
                            QVector<quint32> u2,
                            QWidget* parent)
    : QWidget(parent)
{
    setupUi(this);
    QTableWidgetItem* item = new QTableWidgetItem();
    tableWidget->setItem(0, 0, item);
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(mass[0]));

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(mass[1]));
    tableWidget->setItem(0, 1, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(mass[2]));
    tableWidget->setItem(1, 0, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(mass[3]));
    tableWidget->setItem(1, 1, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(mass[4]));
    tableWidget->setItem(1, 2, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(mass[5]));
    tableWidget->setItem(2, 0, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(mass[6]));
    tableWidget->setItem(2, 1, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(mass[7]));
    tableWidget->setItem(2, 2, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(mass[8]));
    tableWidget->setItem(2, 3, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(w2[0]));
    tableWidget->setItem(0, 4, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(w2[1]));
    tableWidget->setItem(1, 4, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(w2[2]));
    tableWidget->setItem(2, 4, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(s2[0]));
    tableWidget->setItem(0, 5, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(s2[1]));
    tableWidget->setItem(1, 5, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(s2[2]));
    tableWidget->setItem(2, 5, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(u2[0]));
    tableWidget->setItem(0, 6, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(u2[1]));
    tableWidget->setItem(1, 6, item);

    item = new QTableWidgetItem();
    item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    item->setText(QString::number(u2[2]));
    tableWidget->setItem(2, 6, item);
}

